import request from '@/utils/request'

export default {
  //搜索分页查询
  getList(currentPage, pageSize, articleVo) {
    return request({
      url: `/article/search/${currentPage}/${pageSize}`,
      method: 'post',
      data: articleVo
    })
  },
  // 根据ID查询
  queryById(id){
    return request({
      url: `/article/${id}`,
      method: 'get',
    })
  },
  // 根据ID删除
  remove(id) {
    return request({
      url: `/article/${id}`,
      method: 'delete'
    })
  },
  // 增加
  add(brand) {
    return request({
      url: `/article`,
      method: 'post',
      data: brand
    })
  },
  //编辑
  edit(brand) {
    return request({
      url: `/article`,
      method: 'put',
      data: brand
    })
  },
  //查询所有的培训师头衔
  queryAll() {
    return request({
      url: `/article`,
      method: 'get'
    })
  },
  //修改发布状态
  setStatus(articleId){
    return request({
      url: `/article/sta/${articleId}`,
      method: 'put',
    })
  },
  // 查询章节排序最大值
  getMaxSortByCourseId() {
    return request({
      url: `/article/sort`,
      method: 'get'
    })
  },
}
